package com.ruiyian.project.equipment.service.impl;

import com.ruiyian.project.equipment.domain.EquipmentStatus;
import com.ruiyian.project.equipment.mapper.EquipmentStatusMapper;
import com.ruiyian.project.equipment.service.EquipmentStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author chong
 * @email 673426164@qq.com
 * @create 2021/1/25
 * Desc: 设备状态实现
 */
@Service
public class EquipmentStatusServiceImpl implements EquipmentStatusService {
    @Autowired
    private EquipmentStatusMapper equipmentStatusMapper;
    /**
     * 查询列表
     * @param equipmentStatus
     * @return
     */
    @Override
    public List<EquipmentStatus> selectList(EquipmentStatus equipmentStatus) {
        return equipmentStatusMapper.selectList(equipmentStatus);
    }

    /**
     * 根据id获取对象
     * @param id
     * @return
     */
    @Override
    public EquipmentStatus findOne(Long id) {
        return equipmentStatusMapper.findOne(id);
    }

    /**
     * 删除
     * @param id
     */
    @Override
    public void delete(Long id) {
        equipmentStatusMapper.delete(id);
    }

    /**
     * 编辑
     * @param equipmentStatus
     */
    @Override
    public void edit(EquipmentStatus equipmentStatus) {
        equipmentStatusMapper.edit(equipmentStatus);
    }

    /**
     * 保存
     * @param equipmentStatus
     */
    @Override
    public void save(EquipmentStatus equipmentStatus) {
        equipmentStatusMapper.save(equipmentStatus);
    }
    /**
     * 查询设备属性对应的状态
     * @param flag
     * @param eqId
     * @return
     */
    @Override
    public String selectStatusName(String flag, Long eqId) {
        return equipmentStatusMapper.selectStatusName(flag, eqId);
    }
}
